package org.kermeta.spem.activityautomation.eclipse.installsubclipse;

import org.kermeta.spem.activityautomation.eclipse.runcommand.RunCommand;
import org.kermeta.spem.activityautomationmanager.ActivityAutomation;
import org.kermeta.spem.executioncontext.ExecutionContext;
import org.kermeta.spem.processexecution.utils.model.ModelUtils;
import org.kermeta.spem.processexecution.utils.string.StringUtils;

public class InstallSubclipse implements ActivityAutomation {

	public InstallSubclipse() {
		// TODO Auto-generated constructor stub
	}

	@Override
	public void run(String contextModelPath) {
		ExecutionContext executionContext = ModelUtils.getExecutionContextRoot(contextModelPath);
		String localPathOfTheCurrentEclipseApplication = ModelUtils.getValueOfKey("local path of the current Eclipse application", executionContext);
		String localPathOfTheCurrentEclipseApplicationAfterConversion = StringUtils.convertPathIntoString(localPathOfTheCurrentEclipseApplication);
		String cmd = localPathOfTheCurrentEclipseApplicationAfterConversion+" -application org.eclipse.equinox.p2.director -repository http://subclipse.tigris.org/update_1.8.x -installIU org.tigris.subversion.subclipse.feature.group/1.8.22,org.tigris.subversion.clientadapter.feature.feature.group/1.8.6,org.tigris.subversion.clientadapter.javahl.feature.feature.group/1.7.10";
		RunCommand.runCommand(cmd);
	}

}
